# This is a sample Python script.

# Press Shift+F10 to execute it or replace it with your code.
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.
import requests


def crawlData(stockUrl):
    #  请求头
    header = {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0"
    }
    content = requests.get(url=stockUrl,headers=header)
    print(content.text)
    xpath = "/html/body/div[1]/div/div/div[8]/div[1]/div/div[1]/span[1]/span"


def main(stockUrl):
    # 1. 爬取股票的页面获取怕股票信息
    crawlData(stockUrl)
    # 2. 进行数据分析


# Press the green button in the gutter to run the script.
if __name__ == '__main__':
    stockUrl = "https://quote.eastmoney.com/sz002714.html"
    main(stockUrl)

# See PyCharm help at https://www.jetbrains.com/help/pycharm/
